Using skinned meshes

Skinning is the process of binding a 3D mesh to a skeleton that consists of a hierarchical set of connected bones and which you can use to animate the mesh. Kanzi uses shaders to enable skinning. See Shaders.

Shader that handles the skinning sets the bone count and the amount of bones that can affect a single vertex. You can use only one skinned mesh in a Kanzi Studio project.

If in your Kanzi Studio project your skinned mesh does not work as you intended:

Adding a skinned mesh

Before you can add a skinned mesh to a Kanzi Studio project, in a third-party tool create a 3D model with the skinned mesh and export it to either fbx or dae file format.

To add a skinned mesh to your Kanzi Studio project, in the Assets click Import Assets and import the 3D asset which contains the skinned mesh.

When Kanzi Studio imports a skinned mesh, it:

Setting the number of bones for a skinned mesh

You can set the number of bones in your skinned mesh in the material type of the material that you use for your skinned mesh.

To set the number of bones for a skinned mesh:

  1. In the Library > Materials and Textures > Material Types, select the material type that you use for your skinned mesh.
    For example, select the VertexPhongSkinned material type.
  2. In the Properties set the Value of the KANZI_SHADER_SKINNING_BONE_COUNT preprocessor define to the number of bones your skinned mesh uses and press the Enter key.
    For example, if your skinned mesh uses five bones, set the Value to 5 and press the Enter key.
    TIP

    You can use any Phong material type for your skinned mesh by applying that material to the mesh and setting the Value of the KANZI_SHADER_SKINNING_BONE_COUNT preprocessor define to the number of bones in your skinned mesh. See Modifying the default Phong material types.

See also

3D assets

Preparing 3D assets in third-party tools

Importing 3D assets

Material types and materials

Using material types

Shaders

Editing shaders

Using meshes

Meshes best practices